<!-- chat/templates/chat/index.html -->
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>Chat Rooms</title>
</head>
<body>
<form action="/ors/chat/" method="post">
    Who do you want to chat?<br>
    <input id="room-name-input" type="text" size="100" name="chat-target"><br>
    <button>start chat</button>
</form>

{#    <script>#}
{#        document.querySelector('#room-name-input').focus();#}
{#        document.querySelector('#room-name-input').onkeyup = function(e) {#}
{#            if (e.keyCode === 13) {  // enter, return#}
{#                document.querySelector('#room-name-submit').click();#}
{#            }#}
{#        };#}
{##}
{#        document.querySelector('#room-name-submit').onclick = function(e) {#}
{#            var roomName = document.querySelector('#room-name-input').value;#}
{#            window.location.pathname = '/chat/' + roomName + '/';#}
{#        };#}
{#    </script>#}
</body>
</html>
